﻿@using BlogEngine.Core
@{
    var title = Model.Title;
    var dashboardUrl = Utils.RelativeWebRoot + "admin/index.cshtml";
    var contentUrl = Utils.RelativeWebRoot + "admin/#/content/posts";
    var customUrl = Utils.RelativeWebRoot + "admin/#/custom/themes";
    var settingsUrl = Utils.RelativeWebRoot + "admin/#/settings/basic";
    var profileUrl = Utils.RelativeWebRoot + "admin/#/security/profile";
    var passwordUrl = Utils.RelativeWebRoot + "Account/change-password.aspx";
}
@if (Security.IsAuthenticated)
{
    <div class="Widget widget administration">
        <h4 class="WidgetHeader widget-header">@title</h4>
        <div class="WidgetContent widget-content">
            <ul class="toprounded" id="uxMenu_ulMenu">
                @if (Security.IsAuthorizedTo(Rights.ViewDashboard))
                {
                    <li><a href="@dashboardUrl"><span>@Resources.labels.dashboard</span></a></li>
                }
                @if (Security.IsAuthorizedTo(Rights.CreateNewPosts))
                {
                    <li><a href="@contentUrl"><span>@Resources.labels.content</span></a></li>
                }
                @if (Security.IsAuthorizedTo(Rights.ManageThemes))
                {
                    <li><a href="@customUrl"><span>@Resources.labels.custom</span></a></li>
                }
                @if (Security.IsAuthorizedTo(Rights.AccessAdminSettingsPages))
                {
                    <li><a href="@settingsUrl"><span>@Resources.labels.settings</span></a></li>
                }
                <li><a href="@profileUrl"><span>@Resources.labels.profile</span></a></li>
                <li><a href="@passwordUrl"><span>@Resources.labels.changePassword</span></a></li>
                <li><a href="~/Account/login.aspx?logoff"><span>@Resources.labels.logoff</span></a></li>
            </ul>
        </div>
    </div>
}